﻿using System;

namespace GiveAQuiz.Web.Helpers
{
  /// <summary>
  /// Interface wrapper around common Web Utlity methods that
  /// are normally provided by static classes or classes 
  /// that are otherwise hard to mock and test.
  /// </summary>
  public interface IWebPathHelper
  {
    /// <summary>
    /// Given a virtual path to a resource, create the full URL
    /// path which incorporates the host name and Application 
    /// virtual root.
    /// </summary>
    /// <param name="virtualPath">The virtual path (e.g. ~/Account/LogOn)</param>
    /// <returns>The full URL path (e.g. 
    /// http://www.give-a-quiz.com/GiveAQuiz/Account/Logon)</returns>
    string CreateFullUrl(string virtualPath);

    /// <summary>
    /// Given a relative path to a resource, create the path 
    /// which incorporates the Application virtual root.
    /// </summary>
    /// <param name="virtualPath">The virtual path (e.g. ~/Account/LogOn)</param>
    /// <returns>The application path (e.g. /GiveAQuiz/Account/Logon)</returns>
    string CreateApplicationUrl(string virtualPath);

    /// <summary>
    /// Given a virtual path, return the actual physical
    /// path of the resource on the file system.
    /// </summary>
    /// <param name="virtualPath">The virtual path (e.g. ~/App_Data/foo.txt)</param>
    /// <returns>The physical path (e.g. C:\Inetpub\wwwroot\GiveAQuiz\App_Data\foo.txt)</returns>
    string MapPhysicalPath(string virtualPath);
  }
}
